package com.du.spring.service.impl;

import com.du.spring.pojo.User;
import com.du.spring.dao.UserDao;
import com.du.spring.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : DuJiabao
 * @Date : 2021/2/5 10:32
 * @Project : spring
 * @File : null.java
 * @Desc :
 */
// 一般用Service创建对象
@Service
public class UserServiceImpl implements UserService {
  @Autowired
  private UserDao userDaoImpl;

  @Override
  public int addUser(User user) {
    return userDaoImpl.addUser(user);
  }

  @Override
  public int countUser() {
    return userDaoImpl.countUser();
  }

  @Override
  public User selectUserById(int id) {
    return userDaoImpl.selectUserById(id);
  }

  @Override
  public List<User> selectUsers() {
    return userDaoImpl.selectUsers();
  }

  @Override
  public int deleteUserById(int id) {
    return userDaoImpl.deleteUserById(id);
  }

  @Override
  public int updateUser(User user) {
    return userDaoImpl.updateUser(user);
  }

  @Override
  public void batchAddUsers(List<Object[]> batchArgs) {
    userDaoImpl.batchAddUsers(batchArgs);
  }

  @Override
  public void batchUpdateUsers(List<Object[]> batchArgs) {
    userDaoImpl.batchUpdateUsers(batchArgs);
  }

  @Override
  public void batchDeleteUsers(List<Object[]> batchArgs) {
    userDaoImpl.batchDeleteUsers(batchArgs);
  }
}
